const app = getApp();
const Controller = require('../controllers/controllers.js').controller;
Page({
  data: {
    detail:'',
    isloading:true
  },

  onShow: function (options) {
    this.resumedetail()
  },
  resumedetail(){
    Controller.resumedetail().then(res=>{
      if(res.data.baseData){
        for(var item of res.data.baseData.userHistoryList){
          item.ismore=true
        }
        for(var item of res.data.baseData.userItemList){
          item.ismore=true
        }
        this.setData({
          detail:res.data.baseData
        })
      }
      this.setData({
        isloading:false
      })
    })
  },
  edit(){
    wx.navigateTo({
      url: "/pages/Me/editresume"
    })
  },
  more1(e){
    var index=e.currentTarget.dataset.index;
    var lists=this.data.detail.userHistoryList;
    for(var i=0;i<lists.length;i++){
      lists[index].ismore=false
    }
    this.setData({
      detail:this.data.detail
    })
  },
  more2(e){
    var index=e.currentTarget.dataset.index;
    var lists=this.data.detail.userItemList;
    for(var i=0;i<lists.length;i++){
      lists[index].ismore=false
    }
    this.setData({
      detail:this.data.detail
    })
  },
  onReachBottom: function () {

  },
  onShareAppMessage: function () {

  }
})